#pragma once

static void* utilSingleton = NULL;

class CUtilInstance
{
public:
	CUtilInstance(void);
	~CUtilInstance(void);

	static CUtilInstance* GetInstance()
	{
		if(utilSingleton == NULL)
			utilSingleton = new CUtilInstance();

		return (CUtilInstance*)utilSingleton;
	}

	static void DeleteInstance()
	{
		if (utilSingleton != NULL)
			delete (CUtilInstance*)utilSingleton;

		utilSingleton = NULL;
	}

public:
	char* WCharToChar(WCHAR* wchars);
	WCHAR* CharToWChar(char* chars);

#ifndef LINUX_NAS
	CTime MsToCTime(__int64 ms);
	__int64 CTimeToMs(CTime ctime);
	__int64 GetCurrentTimeByMs();
	CTime GetCurrentTimeByCTime();
#endif

	char* GetNewGuid();
	WCHAR* MakeMessageText(WCHAR* strMessage, WCHAR* strReplace);

	void StringToSystemtime(char* str_time, SYSTEMTIME& stu_time);
	void StringToInt64(char* str_time, __int64& i64_time);
	void Int64ToTimeString(__int64 i64_time, char* str_time);
	void Int64ToTimeStringNoMark(__int64 i64_time, char* str_time);
	void SystemtimeToString(SYSTEMTIME stu_systemtime, char* str_time);
	void FiletimeToString(FILETIME stu_filetime, char* str_time);
	void ResolutionToWidthHeight(char* str_resolution, int& int_width, int& int_height);
	__int64 GetLocalTimeToInt64();
	void GetLocalTimeToString(char* str_time);
};
